package com.robotic.route.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.robotic.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.robotic.route.mapper.InspectionTaskMapper;
import com.robotic.route.domain.InspectionTask;
import com.robotic.route.service.IInspectionTaskService;

/**
 * 巡检路线维护Service业务层处理
 *
 * @author tian
 * @date 2025-08-22
 */
@Service
public class InspectionTaskServiceImpl extends ServiceImpl<InspectionTaskMapper, InspectionTask> implements IInspectionTaskService
{
    @Autowired
    private InspectionTaskMapper inspectionTaskMapper;

    /**
     * 查询巡检路线维护
     *
     * @param id 巡检路线维护主键
     * @return 巡检路线维护
     */
    @Override
    public InspectionTask selectInspectionTaskById(Long id)
    {
        return inspectionTaskMapper.selectInspectionTaskById(id);
    }

    /**
     * 查询巡检路线维护列表
     *
     * @param inspectionTask 巡检路线维护
     * @return 巡检路线维护
     */
    @Override
    public List<InspectionTask> selectInspectionTaskList(InspectionTask inspectionTask)
    {
        return inspectionTaskMapper.selectInspectionTaskList(inspectionTask);
    }

    /**
     * 新增巡检路线维护
     *
     * @param inspectionTask 巡检路线维护
     * @return 结果
     */
    @Override
    public int insertInspectionTask(InspectionTask inspectionTask)
    {
        inspectionTask.setCreateTime(DateUtils.getNowDate());
        return inspectionTaskMapper.insertInspectionTask(inspectionTask);
    }

    /**
     * 修改巡检路线维护
     *
     * @param inspectionTask 巡检路线维护
     * @return 结果
     */
    @Override
    public int updateInspectionTask(InspectionTask inspectionTask)
    {
        inspectionTask.setUpdateTime(DateUtils.getNowDate());
        return inspectionTaskMapper.updateInspectionTask(inspectionTask);
    }

    /**
     * 批量删除巡检路线维护
     *
     * @param ids 需要删除的巡检路线维护主键
     * @return 结果
     */
    @Override
    public int deleteInspectionTaskByIds(Long[] ids)
    {
        return inspectionTaskMapper.deleteInspectionTaskByIds(ids);
    }

    /**
     * 删除巡检路线维护信息
     *
     * @param id 巡检路线维护主键
     * @return 结果
     */
    @Override
    public int deleteInspectionTaskById(Long id)
    {
        return inspectionTaskMapper.deleteInspectionTaskById(id);
    }
}
